-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(s3): support SSE-C headers for the MultipartCopy call #41366
Merged
juliusknorr
merged 1 commit into
nextcloud:master
from
ir0nhide:fix/multipart-copy-ssec
Nov 15, 2023
Merged
fix(s3): support SSE-C headers for the MultipartCopy call #41366
juliusknorr
merged 1 commit into
nextcloud:master
from
ir0nhide:fix/multipart-copy-ssec
Nov 15, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
juliusknorr
reviewed
Nov 9, 2023
juliusknorr
requested changes
Nov 9, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small codestyle comment, but otherwise this looks good 👍
Merged
ir0nhide
force-pushed
the
fix/multipart-copy-ssec
branch
from
November 9, 2023 20:12
476c8a7
to
b1ce4c5
Compare
@juliushaertl thank you for the review, codestyle should be better now. |
juliusknorr
approved these changes
Nov 9, 2023
solracsf
reviewed
Nov 10, 2023
solracsf
reviewed
Nov 10, 2023
Small comment as we normaly use camelCase for variables. Good otherwise. |
ir0nhide
force-pushed
the
fix/multipart-copy-ssec
branch
from
November 10, 2023 08:16
b1ce4c5
to
8e6ef54
Compare
@solracsf thanks for the review, should be fixed now. |
solracsf
approved these changes
Nov 10, 2023
Merged
Signed-off-by: Tobias Zimmerer <[email protected]>
ir0nhide
force-pushed
the
fix/multipart-copy-ssec
branch
from
November 14, 2023 20:20
8e6ef54
to
cdf96fa
Compare
Merged
/backport to stable27 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Since a few weeks, I see a lot of HTTP 400 Bad Request errors on HeadObject calls in my Nextcloud logs.
Furthermore I realized, that it is no longer possible to copy a file using the Web-UI.
After further investigations I found out, that this problem is related to the switch to MultipartCopy for copyObject operations on S3 Object Storages.
Looking into the code of the AWS PHP SDK, MultipartCopy executes a headObject request to retrieve the metadata of the source object:
https://github.com/aws/aws-sdk-php/blob/master/src/S3/MultipartCopy.php#L193
Unfortunately, this request is executed without adding any additional Headers like SSE-C, so that this call fails on setups using SSE-C.
To fix this issue, the source object's metadata can be fetched by a separate headObject request and directly provided to the MultipartCopy object as an input argument, skipping the included headObject request (https://github.com/aws/aws-sdk-php/blob/master/src/S3/MultipartCopy.php#L196).
This Pull Requests fixes the broken copyObject function on Nextcloud setups using SSE-C for Primary S3 Object Storage.